import request from '@/utils/request'

// 单位信息列表
  export function getCompanyList(data = {}) {
    return request({
      url: `/talent/TalentCompanyInfo/getList`,
      method: 'post',
      data
    })
  }

  //单位信息详情
  export function getCompanyDetail(id = '') {
    return request({
      url: `/talent/TalentCompanyInfo/${id}`,
      method: 'get',
    })
  }

  //人才列表
  export function getTalentList(data = {}) {
    return request({
      url: `/talent/TalentPersonInfo/getList`,
      method: 'post',
      data
    })
  }

  //人才详情
  export function getTalentDetail(id = '') {
    return request({
      url: `/talent/TalentPersonInfo/${id}`,
      method: 'get',
    })
  }

  //项目列表
  export function getProjectList(data = {}) {
    return request({
      url: `/talent/TalentProjectInfo/getList`,
      method: 'post',
      data
    })
  }
  
  //项目详情
  export function getProjectDetail(id = '') {
  return request({
    url: `/talent/TalentProjectInfo/${id}`,
    method: 'get',
  })
}

//联系人列表
export function getContactList(data = {}) {
  return request({
    url: `/talent/TalentCompanyContactInfo/getList`,
    method: 'post',
    data
  })
}


//字典
export function getDictSelect(type) {
  return request({
    url: `/system/DictionaryData/getDicListByType`,
    method: 'post',
    data: { dictionaryType: type }
  })
}

//修改单位信息
export function editCompanyInfo(data) {
  return request({
    url: `/talent/TalentCompanyInfo/${data.uscc}`,
    method: 'put',
    data
  })
}

//单位联系人列表

//联系人列表
export function getCompanyContactList(data = {}) {
  return request({
    url: `/talent/TalentCompanyContactInfo/getList`,
    method: 'post',
    data
  })
}

//修改单位联系人信息
export function editCompanyContact(data) {
  return request({
    url: `/talent/TalentCompanyContactInfo/${data.contactId}`,
    method: 'put',
    data
  })
}

//创建单位联系人

export function creatCompanyContact(data) {
  return request({
    url: `/talent/TalentCompanyContactInfo`,
    method: 'post',
    data
  })
}

//人才工作经历列表
export function getWorkHistoryList(data = {}) {
  return request({
    url: `/talent/TalentPersonWorkHistory/getList`,
    method: 'post',
    data
  })
}


//人员信息修改
export function editTalentPerson(data) {
  return request({
    url: `/talent/TalentPersonInfo/${data.personId}`,
    method: 'put',
    data
  })
}

//人才信息创建
export function creatTalentPerson(data) {
  return request({
    url: `/talent/TalentPersonInfo`,
    method: 'post',
    data
  })
}

//工作经历修改
export function editWorkHistory(data) {
  return request({
    url: `/talent/TalentPersonWorkHistory/${data.historyId}`,
    method: 'put',
    data
  })
}

//工作经历创建
export function creatWorkHistory(data) {
  return request({
    url: `/talent/TalentPersonWorkHistory`,
    method: 'post',
    data
  })
}

//项目信息修改
export function editProject(data) {
  return request({
    url: `/talent/TalentProjectInfo/${data.projectId}`,
    method: 'put',
    data
  })
}


//创建项目信息
export function creatProject(data = {}) {
  return request({
    url: `/talent/TalentProjectInfo`,
    method: 'post',
    data
  })
}

//人才概况统计(id即companyId)
export function getTalentStatistics(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentProfile/${id}`,
    method: 'get',
  })
}

//人才学历分析(id即companyId)
export function getTalentEduChart(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentEduChartData/${id}`,
    method: 'get',
  })
}

//人才职称分析(id即companyId)
export function getTalentTitleChart(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentTitleChartData/${id}`,
    method: 'get',
  })
}


//人才等级分析
export function getTalentDjfxChart(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentPersonLevelChartData/${id}`,
    method: 'get',
  })
}

//合同到期预警
export function getContractWarning(id = '') {
  return request({
    url: `/talent/TalentStatisticsForTaiZhouTong/getTalentPersonContractWarningData/${id}`,
    method: 'get',
  })
}


//行政区划
export function getOrigin() {
  return request({
    url: `/talent/TalentSystemInfo/getRegionOptions`,
    method: 'get',
  })
}

//获取当前用户信息
export function getUserInfo() {
  return request({
    url: `/oauth/CurrentUser`,
    method: 'get',
  })
}

// 添加职位信息

export function creatPositionInfo(data = {}) {
  return request({
    url: `/talent/TalentPersonPositionInfo`,
    method: 'post',
    data
  })
}

//企业申请信息创建
export function companyApply(data = {}) {
  return request({
    url: `/talent/TalentCompanyApplyInfo`,
    method: 'post',
    data
  })
}

//企业申请信息列表
export function companyApplyInfoList(data = {}) {
  return request({
    url: `/talent/TalentCompanyApplyInfo/getList`,
    method: 'post',
    data
  })
}  

//企业申请详情信息
export function getTalentCompanyApplyInfo(id = '') {
  return request({
    url: `/talent/TalentCompanyApplyInfo/${id}`,
    method: 'get',
  })
}

//公共数据平台-通过统一社会信用代码获取单位信息
export function getPublicCompanyInfo(data = {}) {
  return request({
    url: `/talent/PublicData/getCompanyInfo`,
    method: 'post',
    data
  })
} 

//公共数据平台-通过统一社会信用代码获取单位信息
export function getPublicPersonInfo(data = {}) {
  return request({
    url: `/talent/PublicData/getPersonInfo`,
    method: 'post',
    data
  })
} 

//获取泰州通的登陆手机号
export function getTztPhone(data = {}) {
  return request({
    url: `/taizhoutong/userInfo`,
    method: 'post',
    data
  })
}

//根据地名获取信息
export function getRegionName(data = {}) {
  return request({
    url: `/talent/TalentSystemInfo/getRegionInfoByName`,
    method: 'post',
    data
  })
}